package demo;
 abstract class Shape {
   /* public int count = 10;
    public static int size = 10;   抽象类可以和普通类一样，有成员方法和成员变量。
    public void text1() {
    }*/
    public abstract void draw();
}
class Heart extends Shape {

    @Override
    public void draw() {
        System.out.println("画🧡");
    }
}

class Cycle extends Shape {

    @Override
    public void draw() {
        System.out.println("画⭕");
    }
}
class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("画❀");
    }
}
abstract class Person {
    public String name;
    public int age;
    public Person(String name,int age) {
        this.name = name;
        this.age = age;
    }
}
class Student extends Person {
     public Student(){
         super("张三",10);
     }//两种都可以
    /*public Student(String name, int age) {
        super(name, age);
    }*/
}
public class text {
     public static void fun(Shape shape) {
        shape.draw();
     }
     public static void fun1(Student student1) {
         Student student = new Student();
         System.out.println(student.age+"岁的"+student.name+"正在学习");
     }
     public static void main(String[] args) {
       //Shape shape = new Shape();不能被实例化
         Heart heart = new Heart();
         heart.draw();
         //发生了多态
        fun(new Heart());
        fun(new Cycle());
        fun(new Flower());
        fun1(new Student());
    }
}